<template>
  <div class="app-container">
    <el-form :inline="true" :model="formModal" :ref="formRef" class="demo-form-inline">
      <slot></slot>
      <el-button class="filter-item" type="primary" icon="el-icon-search" @click="onFilter">搜索</el-button>
      <el-button @click="reset">重置</el-button>
    </el-form>
  </div>
</template>

<script>
  import {resetForm} from '@/build'

  export default {
    name: "form-filter-wrap",
    mixins: [resetForm],
    props: {
      formRef:{
        type: String,
        default:'filter'
      },
      formModal: {
        type: Object,
        default: {}
      }
    },
    data(){
      return{
        filter:{
          trade_type:''
        }
      }
    },
    methods: {
      reset() {
        const vm = this;
        vm.resetForm(vm.formRef);
        vm.$emit('reset-form', {})
      },
      onFilter(){
        const vm = this
        vm.$emit('on-filter', vm.formModal)

      }
    }
  }
</script>

<style scoped>

</style>
